package com.edu.edumanager.controller;

import com.edu.edumanager.bean.EduUser;
import com.edu.edumanager.vo.EduResult;
import org.springframework.web.bind.annotation.*;

/**
 * @program: edu-manager
 * @description:
 * @author: Jaime
 * @create: 2021-08-10 11:00
 **/
//http://localhost:8080/eduservice/teacher/user/login
@RestController
@RequestMapping("/eduservice/user")
@CrossOrigin
public class EduLoginController {
    /**
     * 登錄方法
     * @param user
     * @return
     */
    @PostMapping("/login")
    public EduResult login(@RequestBody EduUser user){
        return EduResult.ok().data("token","admin");
    }

    @GetMapping("/info")
    public EduResult getInfo(String token){
        return  EduResult.ok().data("roles","admin").data("name","德鲁伊").data("avatar","http://localhost:8080/eduservice/teacher/user/login");
    }
}
